<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRulePolicyFlightTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('rule_policy_flight', function (Blueprint $table) {
            $table->increments('id');
            $table->bigInteger('policy_id')->comment('政策ID');
            $table->tinyInteger('way')->default(1)->comment('类型：1=去程，2=返程');
            $table->tinyInteger('type')->default(1)->comment('类型：1=可用航班，2=禁用航班');
            $table->char('depart_city_code',3)->comment('起飞机场');
            $table->char('arrived_city_code',3)->comment('到达机场');
            $table->integer('flight_start')->comment('起始航班号');
            $table->integer('flight_end')->comment('截止航班号');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('rule_policy_flight');
    }
}
